<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <ui:composition template="/publico/templates/principal.xhtml">

        <ui:define name="titulo">
            #{msgs.PageTitle}
        </ui:define>
        <ui:define name="corpo">
            <h:form id="form">  

                <p:growl id="messages" showDetail="true" />  

                <p:schedule id="schedule" value="#{scheduleController.eventModel}" widgetVar="myschedule">  

                    <p:ajax event="dateSelect" listener="#{scheduleController.onDateSelect}" update="eventDetails" oncomplete="PF('eventDialog').show()" />  
                    <p:ajax event="eventSelect" listener="#{scheduleController.onEventSelect}" update="eventDetails" oncomplete="PF('eventDialog').show()" />  
                    <p:ajax event="eventMove" listener="#{scheduleController.onEventMove}" update="messages" />  
                    <p:ajax event="eventResize" listener="#{scheduleController.onEventResize}" update="messages" />  

                </p:schedule>  

                <p:dialog widgetVar="eventDialog" header="Detalhe do Evento" showEffect="clip" hideEffect="clip">  
                    <h:panelGrid id="eventDetails" columns="2">  
                        <h:outputLabel for="cliente" value="Cliente:" />  
                        <p:inputText id="cliente" value="#{agendaBean.agenda.cliente}" required="true"/>  

                        <h:outputLabel for="Responsavel" value="Responsavel:" />  
                        <p:inputText id="Responsavel" value="#{agendaBean.agenda.responsavel}" required="true"/>  

                        <h:outputLabel for="Dinicio" value="Data Inicio:" />  
                        <p:inputMask id="Dinicio" value="#{agendaBean.agenda.dataInicio}" mask="99/99/9999">  
                            <f:convertDateTime pattern="dd/MM/yyyy" />  
                        </p:inputMask> 

                        <h:outputLabel for="Hinicio" value="Hora Inicio:" />  
                        <p:inputMask id="Hinicio" value="#{agendaBean.agenda.horaInicio}" mask="99:99">  
                            <f:convertDateTime pattern="hh:mm" />  
                        </p:inputMask> 

                        <h:outputLabel for="problema" value="Problema:" />  
                        <p:inputTextarea id="problema" rows="6" cols="33" value="#{agendaBean.agenda.problema}" />  

                        <h:outputLabel for="Hfim" value="Hora Fim:" />  
                        <p:inputMask id="Hfim" value="#{agendaBean.agenda.horaFim}" mask="99:99">  
                            <f:convertDateTime pattern="hh:mm" />  
                        </p:inputMask> 

                        <h:outputLabel for="Dfim" value="Data Fim:" />  
                        <p:inputMask id="Dfim" value="#{agendaBean.agenda.dataFim}" mask="99/99/9999">  
                            <f:convertDateTime pattern="dd/MM/yyyy" />  
                        </p:inputMask>  

                        <h:outputLabel for="Solucao" value="Solução:" />  
                        <p:inputTextarea id="Problema" rows="6" cols="33" value="#{agendaBean.agenda.solucao}" />  

                        <h:outputText value="Status: " />  
                       
                        <p:selectOneMenu id="stattus" value="#{agendaBean.agenda.status}">  
                            <f:selectItem itemLabel="Selecione o Status" itemValue="" />  
                             <f:selectItem itemLabel="Espera" itemValue="ESPERA" />  
                            <f:selectItem itemLabel="No Cliente" itemValue="NO CLIENTE" />  
                            <f:selectItem itemLabel="Resolvido" itemValue="RESOLVIDO" />
                            
                        </p:selectOneMenu>  

                        <p:commandButton type="limpar" value="Limpar" />  
                        <p:commandButton id="addButton" value="Salve" actionListener="#{scheduleController.addEvent}" oncomplete="PF('myschedule').update();PF('eventDialog').hide();"/>  
                    </h:panelGrid>  
                </p:dialog>  

            </h:form>  
        </ui:define>
    </ui:composition>
</html>
